package com.ziytek.web.citizen.mapper;

import com.ziytek.web.citizen.configuration.db.DDS;
import com.ziytek.web.citizen.constant.DdsConstant;
import com.ziytek.web.citizen.pojo.basic.DoorConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author fenghx
 * @version 1.0
 * @className DoorMapper
 * Description:
 * @date 2024/3/25 16:08
 */
@Mapper
public interface DoorMapper extends EasyBaseMapper<DoorConfig> {
    /**
     * 查询所有柜子门
     *
     * @return List<DoorConfig> 所有柜子门
     */
    @DDS(DdsConstant.DS_BASIC)
    @Select("SELECT * FROM door_config where enable = 1 order by seqNo ")
    List<DoorConfig> queryAllList();

    /**
     * 根据门号查询柜子门
     *
     * @param door 门号
     * @return List<DoorConfig> 所有柜子门
     */
    @DDS(DdsConstant.DS_BASIC)
    @Select("SELECT * FROM door_config where door = #{door} and enable = 1 order by seqNo limit 1")
    DoorConfig queryByDoor(String door);
}
